/*
	Name:3_3
	Copyright:Take it at will
	Author:Rodney
	Date: 
	Description:
*/
#include<stdio.h>
#include<stdlib.h>

typedef struct STUDENT
{
    int id;
    int socer;
}STU;

int main()
{
    STU *stu;
    int n,i,min;
    scanf("%d",&n);
    stu = (STU *)malloc(n*sizeof(STU));
    for(i=0;i<n;i++)
        scanf("%d%d",&stu[i].id,&stu[i].socer);
    
    for(i=1,min=0;i<n;i++)
        if(stu[min].socer>stu[i].socer) min = i;
    
    printf("%d  %d\n",stu[min].id,stu[min].socer);
}

